let payOrderDao = require('../dao/payOrderDao');
let mysqlPool = require('../dao/MySQLPool');
let userDao = require('../dao/userDao');
let payConst = require('../const/payConst');

const { BusiError, SysError } = require('../exception/exception');

class PayOrderNotThingService {
    constructor(){
        this.serviceName = "C3";
        this.remark = "记录订单处理器";
    }

    async process(order){
        await mysqlPool.doWithTx(async function (conn) {
            let res2 = await payOrderDao.updateByOutTradeNoWithTx(conn, order);
            if (res2 < 1) {
                console.logw("更新订单失败:", order);
                throw new BusiError(500, "更新订单失败");
            }
        });
    }
}


let payOrderNotThingService = new PayOrderNotThingService();
module.exports = payOrderNotThingService;